Spot on with the cl.makefile('wb') Eric, although I can't tell how you figured that out from that doc page. No matter it works now! If I change 'import socket' to 'import usocket as socket' it runs the same so the pycom library must have both?